<div nz-row>
  <div nz-col [nzSpan]="6" style="float:left">
    <nz-input-group [nzSuffix]="suffixIconSearch" style="width: 400px">
      <input type="text" nz-input placeholder="请输入搜索内容..." [(ngModel)]="filter" (keyup.enter)="getUserPage(true)">
    </nz-input-group>
    <ng-template #suffixIconSearch>
      <i nz-icon type="search"></i>
    </ng-template>
  </div>
  <div nz-col [nzSpan]="18" style="text-align: right">
    <button *szAcl="['create_user']" nz-button nzType="primary" (click)="addUserModal()">
      <i class="icon-sac-usergroup-add"></i>
      创建用户
    </button>
  </div>
</div>
<div class="custom_table">
  <nz-table #userTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzTotal]="total"
    [nzLoading]="loading" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getUserPage()"
    (nzCurrentPageDataChange)="currentPageDataChange($event)" (nzPageSizeChange)="getUserPage(true)">
    <thead>
      <tr>
        <th nzShowSort nzSortKey="name">姓名</th>
        <th nzShowSort nzSortKey="name">状态</th>
        <th>角色</th>
        <th>所属小组</th>
        <th nzShowSort nzSortKey="email">最后一次登录时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let data of userTable?.data">
        <td>
          <p>
            <strong>{{ data.lastName }} {{ data.firstName }}</strong>
            <ng-container *ngIf="data.status === 1">
              <small>({{ data.activationTypeValue }})</small>
            </ng-container>
          </p>
          <small>
            <a [href]="'Mailto:' + data.email">{{ data.email }}</a>
          </small>
        </td>
        <td>
          <ng-container *ngIf="data.statusName==='激活'; else statusName">
            <p class="grade-B">
              {{ data.statusName }}
            </p>
          </ng-container>
          <ng-template #statusName>
            <p class="grade-A">
              {{ data.statusName }}
            </p>
          </ng-template>

        </td>
        <td> {{ data.roleName | noData}} </td>
        <td> {{ data.groupName | noData}} </td>
        <td> {{ data.modifyTime }} </td>
        <td>
          <a
            (click)="editUserModal(data.email,data.firstName,data.lastName,data.groupUuid,data.roleUuid,data.userUuid)">编辑</a>
          <nz-divider nzType="vertical"></nz-divider>
          <a nz-popconfirm nzTitle="确定要删除吗?删除后数据将无法恢复!" [nzCondition]="switchValue"
            (nzOnConfirm)="confirm(data.userUuid)" (nzOnCancel)="cancel()">删除</a>
        </td>
      </tr>
    </tbody>
  </nz-table>
</div>